package com.sinog.basic.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sinog.core.domain.RoleRes;
import com.sinog.core.utilbean.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

/**
 * @desc 角色资源service
 * @author liuchaoyang
 * @date Created in 2019年07月09日  15点25分
 */
@RestController
public interface RoleResService extends IService<RoleRes> {

    /**
     * 获取角色资源列表
     * @param roleid roleid
     * @return String
     */
    @GetMapping("/role/resource/tree")
    String getRoleResourcesTree(@RequestParam("roleid") String roleid);

    /**
     * 保存角色资源列表
     * @param resMap resMap
     * @param roleid roleid
     * @param userName userName
     * @return Result
     */
    @PostMapping("/role/resource")
    Result saveRoleResources(
            @RequestBody Map<String,String> resMap,
            @RequestParam("roleid") String roleid,@RequestParam("userName") String userName);
}